#pragma once

#include "Globals.h"
#include "Space.h"

class Board
{
private:
	Board();
	Space**					m_clppMyGrid;
	Vector<BaseObject*>*	m_clpAllSpecials;
	DrawList*				m_clpAllObjects;
	D3DXVECTOR3				m_vCenter;
	Vector<int>*			m_bPattern;
	bool*					m_bMaterialPattern;
	int						m_iSizeType;
	int						m_iBoardPosMod;
	bool					m_bBoardCreated;
	bool					m_bForward;
public:
	~Board();
	inline static Board* Engine()
	{
		static Board TheWorld;
		return &TheWorld;
	}
	DrawList* GetDrawList() const 
	{
		return m_clpAllObjects;
	}
	const FunctionReturn Init(int const & Size);
	const FunctionReturn Create(int const & Size);
	const FunctionReturn ChangeMapSize(int const & Size){RETURN_CHECK(Reset(Size));}
	const FunctionReturn Reset();
	const FunctionReturn Reset(int const & Size);
	const FunctionReturn Delete();
	const FunctionReturn Deconstruct();
	const FunctionReturn PlaceBoardTiles(int const & x,int const & y);
	const FunctionReturn PlaceSpecials();
	const FunctionReturn AddSpecialTiles(int x1,int x2,int y1,int y2,eSpaceType Type);
	const FunctionReturn CheckPattern();
	const FunctionReturn ResetPattern();
	const FunctionReturn SetListInfo(DrawList* List) const;
	Space* GetFirstSpace(){return &m_clppMyGrid[0][0];}
};